<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
</head>
<body>


<table class="table table-bordered">
    <tr>
        <td  class="td_width">
            <form action="addTeachers" method="post" enctype="multipart/form-data">
                <input class="easyui-filebox" id="teacher" name="teacherInfoFile" data-options="buttonText:'选择',prompt:'选择新增教师信息文件...'" style="width:100%">
                <button type="button" class="btn btn-outline-primary btn-block btn-line-height">导入系统</button>
            </form>
        </td>
        <td  class="td_width">
            <form action="addTeachInfos" method="post" enctype="multipart/form-data">
                <input class="easyui-filebox" id="teachinfo" name="teachInfoFile" data-options="buttonText:'选择',prompt:'选择新增任教信息文件...'" style="width:100%">
                <button type="button" class="btn btn-outline-primary btn-block btn-line-height">导入系统</button>
            </form>
        </td>
        <td  class="td_width">
            <form action="addStudents" method="post" enctype="multipart/form-data">
                <input class="easyui-filebox" id="studentinfo" name="studentinfoFile" data-options="buttonText:'选择',prompt:'选择新增学生信息文件...'" style="width:100%">
                <button type="button" class="btn btn-outline-primary btn-block btn-line-height">导入系统</button>
            </form>
        </td>

    </tr>
    <tr>

        <td class="td_width">
            <form action="addScores" method="post" enctype="multipart/form-data" onsubmit="return addScores()">
                <input id="gradeName" type="text" name="gradeName" value="" hidden>
                <select id="selectGradeName" class="form-control form-control-sm" name="gradeDatatableName" style="width: 49%;display: inline-block">
                    <option value=" ">选择新增成绩的年级</option>
                    <option th:each="grade : ${session.grades}" th:value="${grade.gradeDatatableName}"  th:text="${grade.gradeName}"></option>
                </select>
                <input class="easyui-filebox" id="score" name="scoresFile"   data-options="buttonText:'选择',prompt:'选择新增成绩信息文件...'" style="width:49%;display:inline-block;float: right;">
                <button id="addScores_btn" type="button" class="btn btn-outline-primary btn-block btn-line-height">导入系统</button>
            </form>
        </td>

    </tr>
</table>

<script type="text/javascript" th:inline="none">
    $(function () {
        $("button").bind("click", function () {
            $(this).closest("form").submit();
        });
    });

    function addScores() {
        $("#gradeName").val($("#selectGradeName").find("option:selected").text());
    }

    /**
     * Name 打开修改窗口
     */
    function openEdit() {
        $('#wu-form-2').form('clear');
        var item = $('#wu-datagrid-2').datagrid('getSelected');
        $.ajax({
            url: '',
            data: '',
            success: function (data) {
                if (data) {
                    $('#wu-dialog-2').dialog('close');
                } else {
                    //绑定值
                    $('#wu-form-2').form('load', data)
                }
            }
        });
        $('#wu-dialog-2').dialog({
            closed: false,
            modal: true,
            title: "修改信息",
            buttons: [{
                text: '确定',
                iconCls: 'icon-ok',
                handler: edit
            }, {
                text: '取消',
                iconCls: 'icon-cancel',
                handler: function () {
                    $('#wu-dialog-2').dialog('close');
                }
            }]
        });
    }

</script>
</body>